<?php
$loader->requireOnce('BedFeeItem.class.php');
$loader->requireOnce('ServiceFeeItem.class.php');
$loader->requireOnce('ParacliniqueFeeItem.class.php');
$loader->requireOnce('MedicineFeeItem.class.php');
$loader->requireOnce('MaterialFeeItem.class.php');
$loader->requireOnce('PaymentConstant.class.php');
class BillableItemFactory {
	public function create($type) {
        switch ($type) {
        	case PaymentConstant::ITEM_BED:
        		return new BedFeeItem();
        	case PaymentConstant::ITEM_MATERIAL:
        		return new MaterialFeeItem();
        	case PaymentConstant::ITEM_MEDICINE:
                return new MedicineFeeItem();
            case PaymentConstant::ITEM_PARACLINIQUE:
                return new ParacliniqueFeeItem();
            case PaymentConstant::ITEM_SERVICE:
                return new ServiceFeeItem();
            default:
            	throw new PaymentException("Billable item type '$type' is not supported",
            	   PaymentErrorCode::BILLABLE_ITEM_TYPE_NOT_SUPPORTED);
        }
	}
}
?>